﻿<%@ Page Title="Juramant" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Juramant.aspx.vb" Inherits="eServicii.About" %>

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <style type="text/css">
        #Div2
        {
            width: 550px;
            height: 83px;
        }
        #Div1
        {
            width: 550px;
            height: 30px;
        }
        .auto-style2 {
            margin-left: 109px;
            height: 425px;
            width: 1005px;
        }
        .auto-style3 {
            width: 504px;
            height: 67px;
            margin-left: 112px;
        }
        .auto-style4 {
            width: 502px;
            height: 22px;
            margin-left: 116px;
        }
        .auto-style5 {
            float: right;
            width: 459px;
            height: 153px;
            margin-left: 2px;
        }
        .auto-style8 {
            width: 584px;
            height: 74px;
        }
        .auto-style9 {
            float: right;
            width: 99px;
            height: 30px;
            margin-top: 0px;
            margin-left: 3px;
        }
        .auto-style10 {
        margin-left: 0px;
    }
    .auto-style11 {
        width: 264px;
    }
        </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div ID="DivMenuRight" runat="server" class="auto-style9" >

        <asp:Button ID="ButtonProgr" runat="server" Text="Programări" Width="92px" 
            BackColor="#506272" ForeColor="White" Height="32px" Visible="False" />
&nbsp;<asp:Button ID="ButtonCertif" runat="server" Text="Certificate" Width="87px" 
            Height="31px" BackColor="#506272" ForeColor="White" />

  </div>
    <h2>
       Depunerea jurământului
    </h2>
   <div ID="DivR" runat="server" class="auto-style5">

       <asp:Calendar ID="Calendar1" runat="server" BackColor="White" 
           BorderColor="#3366CC" BorderWidth="1px" CellPadding="1" 
           DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" 
           ForeColor="#003399" Height="154px" Width="216px" style="margin-left: 0px">
           <DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
           <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
           <OtherMonthDayStyle ForeColor="#999999" />
           <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
           <SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
           <TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" 
               Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
           <TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
           <WeekendDayStyle BackColor="#CCCCFF" />
       </asp:Calendar>

</div>

<div style="margin-left: 34px;" class="auto-style8" >

   <blockquote style="margin-left: 490px" >

     <asp:Label ID="DataDepJur" runat="server" Font-Bold="True" align="right"
         Text="Selectaţi data jurământului" Width="90px"></asp:Label>

   
    
        </blockquote>
   

</div>
<div class="auto-style4" >

    <asp:Label ID="Label1" runat="server" BackColor="White" Font-Bold="True" 
        Text="Introduceti numele si prenumele:"></asp:Label>

</div>
<div class="auto-style3" >

     <table style="width:100%;">
         <tr>
             <td class="auto-style11"><asp:TextBox ID="TextBox1" runat="server" BackColor="#CCCCFF" 
            BorderStyle="Ridge" CssClass="textEntry" Font-Bold="True" Height="26px" 
            style="margin-left: 0px" Width="242px" BorderColor="#F0F0F0" 
            BorderWidth="2px" CausesValidation="True"></asp:TextBox></td>
             <td> <asp:Button ID="Button_Cautare" runat="server" 
            Text="&gt;&gt;" BackColor="#003399" 
            Font-Bold="True" ForeColor="White" Height="35px" Width="91px" 
                     CssClass="auto-style10" />

     <asp:TextBox ID="TextBoxMisID" runat="server" Width="16px" ForeColor="Black" 
         Visible="False"></asp:TextBox>

     <asp:TextBox ID="TextBoxUserID" runat="server" Width="16px" ForeColor="Black" 
         Visible="False"></asp:TextBox></td>
            
         </tr>           
         <tr>
             <td class="auto-style11">
                 <asp:Label ID="LabelMSG" runat="server" Text="Label" Font-Bold="True" 
                     ForeColor="#CC3300" Visible="False"></asp:Label>
             </td>
             <td> &nbsp;</td>
            
         </tr>           
     </table>
</div>

    <div class="auto-style2" >   
 
            <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" 
                CellPadding="3" CellSpacing="1" DataKeyNames="ID" DataSourceID="SqlDataSource1" 
                GridLines="None" Height="34px" Width="770px" AllowPaging="True"
                OnDataBound = "DetailsView1_DataBound"
                OnItemUpdating="DetailsView1_ItemUpdating" 
                OnItemDeleting="DetailsView1_ItemDeleting" 
                OnItemDeleted="DetailsView1_ItemDeleted">
                <EditRowStyle BackColor="#003399" Font-Bold="True" ForeColor="White" 
                    />
                <Fields>
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            &nbsp;<asp:Button ID="deleteButton" runat="server" CausesValidation="False" 
                                CommandName="Delete" Text="Salvează programare" />
                            <asp:Button ID="editButton" runat="server" CausesValidation="False" 
                                CommandName="Edit" Text="Corectează date" />
                            &nbsp;<asp:Button ID="newButton" runat="server" CausesValidation="False" 
                                CommandName="New" Text="Adaugă persoană" />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:Button ID="updateButton" runat="server" CausesValidation="True" 
                                CommandName="Update" Text="Salvare" />
                            &nbsp;<asp:Button ID="cancel_updateButton" runat="server" CausesValidation="False" 
                                CommandName="Cancel" Text="Anulare" />
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:Button ID="insertButton" runat="server" CausesValidation="True" 
                                CommandName="Insert" Text="Adăugare" />
                            &nbsp;<asp:Button ID="cancel_insertButton2" runat="server" CausesValidation="False" 
                                CommandName="Cancel" Text="Anulare" />
                        </InsertItemTemplate>
                        <ControlStyle Height="35px" Width="160px" />
                        <HeaderStyle Height="30px" />
                        <ItemStyle Height="30px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="MisiuneID" HeaderText="MisiuneID" 
                        SortExpression="MisiuneID" ItemStyle-CssClass="hiddenrow">
                    <ControlStyle CssClass="hiddenrow" Font-Size="0pt" ForeColor="#F7F3F7" 
                        Height="0px" />
                    <FooterStyle CssClass="hiddenrow" Height="0px" />
                    <HeaderStyle CssClass="hiddenrow" Font-Size="0pt" ForeColor="#F7F3F7" 
                        Height="0px" />
<ItemStyle CssClass="hiddenrow" Font-Size="0pt" ForeColor="#F7F3F7" Height="0px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="DataDepJur" DataFormatString="{0:d}" 
                        HeaderText="Data jurământului" SortExpression="DataDepJur" 
                        HtmlEncode="False" HtmlEncodeFormatString="False" InsertVisible="False" 
                        ReadOnly="True">
                    <ControlStyle Width="160px" />
                    <HeaderStyle Width="160px" Height="20px" />
                    <ItemStyle Width="160px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="NrCertificat" HeaderText="Nr certificat" 
                        SortExpression="NrCertificat" HtmlEncode="False" 
                        HtmlEncodeFormatString="False" InsertVisible="False" ReadOnly="True" >
                    <HeaderStyle Height="20px" Width="160px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Nume" HeaderText="Numele și prenumele" 
                        SortExpression="Nume" ReadOnly="True" >
                    <HeaderStyle Height="20px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="DataNastere" DataFormatString="{0:d}" 
                        HeaderText="Data nașterii" SortExpression="DataNastere" ReadOnly="True" >
                    <HeaderStyle Height="20px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FiulFiica" HeaderText="Detalii ANC" 
                        SortExpression="FiulFiica" ReadOnly="True" >
                    <HeaderStyle Height="35px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="LocTaraNastere" HeaderText="Locul nașterii" 
                        SortExpression="LocTaraNastere" >
                        <HeaderStyle Height="20px" />
                        </asp:BoundField>
                    <asp:BoundField DataField="NumeTATA" HeaderText="Prenumele tatălui" 
                        SortExpression="NumeTATA" >
                        <HeaderStyle Height="20px" />
                        </asp:BoundField>
                    <asp:BoundField DataField="NumeMAMA" HeaderText="Prenumele mamei" 
                        SortExpression="NumeMAMA" >
                        <HeaderStyle Height="20px" />
                        </asp:BoundField>
                    <asp:BoundField DataField="CopiiMinori" HeaderText="Copii minori" 
                        SortExpression="CopiiMinori" />
                    <asp:BoundField DataField="Observatii" HeaderText="Observații" 
                        SortExpression="Observatii" />
                    <asp:BoundField DataField="NrOrdin" HeaderText="Nr ordin / data" 
                        SortExpression="NrOrdin" />
                    <asp:BoundField DataField="NrDosar" HeaderText="Nr dosar" 
                        SortExpression="NrDosar" />
                    <asp:BoundField DataField="Misiune1" HeaderText="Misiune" 
                        SortExpression="MisiuneID" HtmlEncode="False" 
                        HtmlEncodeFormatString="False" InsertVisible="False" 
                        ConvertEmptyStringToNull="False" />
                    <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                        ReadOnly="True" SortExpression="ID" ItemStyle-CssClass="hiddenrow">
                    <ControlStyle CssClass="hiddenrow" Font-Size="0pt" ForeColor="#F7F3F7" 
                        Height="0px" />
                    <FooterStyle CssClass="hiddenrow" Height="0px" />
                    <HeaderStyle CssClass="hiddenrow" Font-Size="0pt" ForeColor="#F7F3F7" 
                        Height="0px" />
<ItemStyle CssClass="hiddenrow" Font-Size="0pt" ForeColor="#F7F3F7" Height="0px"></ItemStyle>
                    </asp:BoundField>
                </Fields>
                <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
                <InsertRowStyle BackColor="#C6C3C6" ForeColor="Black" Width="300px" />
                <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
                <RowStyle BackColor="#F0F0F0" ForeColor="Black" />
            </asp:DetailsView>
    
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:JURAMANTConnectionString %>" 
                SelectCommand="SELECT ID, Nume, FiulFiica, NrDosar, NrOrdin, CopiiMinori, DataDepJur, Observatii, NrCertificat, NumeTATA, NumeMAMA, DataNastere, LocTaraNastere, MisiuneID, (SELECT Denumire FROM Consulate WHERE Idconsulat=MisiuneID) As Misiune1 FROM CetatenieFULL  WHERE Nume=@Nume" 
                UpdateCommand="UPDATE CetatenieFULL SET NumeTATA=@NumeTATA, NumeMAMA=@NumeMAMA, LocTaraNastere=@LocTaraNastere, CopiiMinori=@CopiiMinori, Observatii=@Observatii WHERE ID=@ID" 
                
                
                DeleteCommand= "UPDATE CetatenieFULL SET DataDepJur = @DataDepJuramant, NrCertificat = (SELECT MAX(NrCertificat) + 1 FROM CetatenieFULL WHERE (MisiuneID = @MisID)), MisiuneID = @MisID, UserId=@user WHERE (ID = @ID)" 
                InsertCommand="INSERT INTO CetatenieFULL(Nume, NrDosar, NrOrdin, CopiiMinori, Observatii, NumeTATA, NumeMAMA, DataNastere, LocTaraNastere) VALUES (@Nume, @NrDosar, @NrOrdin, @CopiiMinori, @Observatii, @NumeTATA, @NumeMAMA, @DataNastere, @LocTaraNastere)">
                
                 <DeleteParameters>
                   <asp:ControlParameter ControlID="Calendar1" Name="DataDepJuramant" 
                        PropertyName="SelectedDate" Type="DateTime" />
                     <asp:ControlParameter ControlID="TextBoxMisID" Name="MisID" PropertyName="Text" />
                     <asp:ControlParameter ControlID="TextBoxUserID" Name="user" PropertyName="Text" />
                    <asp:Parameter Name="ID" />
                </DeleteParameters>                
                 <InsertParameters>
                     <asp:Parameter Name="Nume" />
                     <asp:Parameter Name="NrDosar" />
                     <asp:Parameter Name="NrOrdin" />
                     <asp:Parameter Name="CopiiMinori" />
                     <asp:Parameter Name="Observatii" />
                     <asp:Parameter Name="NumeTATA" />
                     <asp:Parameter Name="NumeMAMA" />
                     <asp:Parameter Name="DataNastere" />
                     <asp:Parameter Name="LocTaraNastere" />
                 </InsertParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="TextBox1" Name="Nume" 
                        PropertyName="Text" DefaultValue="------" />
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Name="NumeTATA" />
                    <asp:Parameter Name="NumeMAMA" />
                    <asp:Parameter Name="LocTaraNastere" />
                    <asp:Parameter Name="CopiiMinori" />
                    <asp:Parameter Name="Observatii" />
                    <asp:Parameter Name="ID" />
                </UpdateParameters>
            </asp:SqlDataSource>
       
        </div>
    
</asp:Content>
